home *** CD-ROM | disk | FTP | other *** search
/ Know Your Hockey - The Greatest Player Resource / Know Your Hockey: The Greatest Player Resource.iso / hockey / director / ktgcst.cst / 00067_Script_rollover_module < prev    next >
Text File  |  1998-09-28  |  2KB  |  72 lines

  1. global EnterRollist,XitRollist,lastrollover,thisrollover
  2.  
  3.  
  4. --- put the name of the handler that you want executed
  5. -- for a specific sprite when the rollover occurs
  6. --  in the internal cast in a field called onlist
  7. -- egsprite 4 ijn list four
  8. -- the first item in the line should be a number then the
  9. -- desired commend separated by a ",'
  10. -- the off list affects what happens when the rollover ends
  11. -- and also requires a handler to be named
  12. -- if no name is present nothing will happen
  13. -- however both onlist and off list must have 48 lines with
  14. -- a number at the start of each of the 48 lines
  15.  
  16. on initrolloverKit
  17.   set lastrollover = empty
  18.   set thisrollover = empty
  19.   set EnterRollist = []
  20.   set XitRollist = []
  21.   set the itemDelimiter = ","
  22.   repeat with x = 1 to 48
  23.     set t = item 2 of (line x of field "onlist" of castlib "internal")
  24.     setat(EnterRollist,x,t)
  25.     set r = item 2 of (line x of field "offlist" of castlib "internal")
  26.     setat(XitRollist,x,r)
  27.   end repeat 
  28. end
  29.  
  30.  
  31. on testforrollovers
  32.   set thisrollover = rollover()
  33.   if thisrollover = 0 then exit
  34.   if (thisRollover <> LastRollover) then
  35.     if lastRollover > 0 then
  36.       do getat(Xitrollist,lastrollover)
  37.     end if
  38.     do getat(EnterRollist, thisrollover)
  39.     set lastrollover = thisRollover
  40.   end if
  41. end
  42.  
  43. -- turns coach or announcer icon off at end of file
  44. on soundover
  45.   if soundbusy(1) then exit
  46.   set flag1 = getat(gbuttonstate,40)
  47.   set flag2 =  getat(gbuttonstate,41)
  48.   set flag = max(flag1,flag2)
  49.   if flag > 0 then
  50.     Autoresetbanner
  51.   end if   
  52.   -- reset golden rule if it was selected
  53.   if getat(gbuttonstate,24) > 0 then
  54.     set the blend of sprite 24 = 0 -- Turnoff Golden rule
  55.     setat(gbuttonState,24,0)
  56.     set the membernum of sprite 24 = the membernum of sprite 24-1
  57.   end if
  58. end
  59.  
  60. on autoresetbanner
  61.   repeat with y = 41 down to 40
  62.     set thisone = getat(gbuttonState,y)
  63.     if thisone > 0  then 
  64.       set the membernum of sprite y = the membernum of sprite y -1
  65.       setat(gbuttonState,y,0)
  66.       exit repeat
  67.     end if
  68.   end repeat 
  69.   if the rollover <> y then set the blend of sprite y = 0
  70.   updatestage
  71. end
  72.